CSSDomain

class CSSDomain : Domain

This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles) have an associated id used in subsequent operations on the related object. Each object type has a specific id structure, and those are not interchangeable between objects of different kinds. CSS objects can be loaded using the get*ForNode() calls (which accept a DOM node id). A client can also keep track of stylesheets via the styleSheetAdded/styleSheetRemoved events and subsequently load the required stylesheet contents using the getStyleSheet[Text]() methods.

This API is marked as experimental in protocol definition and can change in the future.

Functions

addRule
Link copied to clipboard
fun addRule(input: AddRuleRequest): Single<AddRuleResponse>
Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.
collectClassNames
Link copied to clipboard
fun collectClassNames(input: CollectClassNamesRequest): Single<CollectClassNamesResponse>
Returns all class names from specified stylesheet.
createStyleSheet
Link copied to clipboard
fun createStyleSheet(input: CreateStyleSheetRequest): Single<CreateStyleSheetResponse>
Creates a new special "via-inspector" stylesheet in the frame with given frameId.
description
Link copied to clipboard
fun description(): String
Returns domain description.
disable
Link copied to clipboard
fun disable(): Single<RequestResponseFrame>
Disables the CSS agent for the given page.
enable
Link copied to clipboard
fun enable(): Single<RequestResponseFrame>
Enables the CSS agent for the given page.
events
Link copied to clipboard
fun events(): Flowable<Event>
Returns flowable capturing all domains events.
fun events(filter: Predicate<Event>): Flowable<Event>
Returns flowable capturing all domains events matching predicate.
fun <T : Event> events(eventClass: Class<T>): Flowable<T>
Returns flowable capturing all domain events of a given type.
fun <T : Event> events(eventClass: Class<T>, filter: Predicate<T>): Flowable<T>
Returns flowable capturing all domain events of a given type matching predicate.
fontsUpdated
Link copied to clipboard
fun fontsUpdated(): Flowable<FontsUpdatedEvent>
Fires whenever a web font is updated.
forcePseudoState
Link copied to clipboard
fun forcePseudoState(input: ForcePseudoStateRequest): Single<RequestResponseFrame>
Ensures that the given node will have specified pseudo-classes whenever its style is computed by the browser.
getBackgroundColors
Link copied to clipboard
fun getBackgroundColors(input: GetBackgroundColorsRequest): Single<GetBackgroundColorsResponse>
getComputedStyleForNode
Link copied to clipboard
Returns the computed style for a DOM node identified by nodeId.
getDependencies
Link copied to clipboard
open override fun getDependencies(): List<Domain>
Returns list of dependant domains that should be enabled prior to enabling this domain.
getInlineStylesForNode
Link copied to clipboard
Returns the styles defined inline (explicitly in the "style" attribute and implicitly, using DOM attributes) for a DOM node identified by nodeId.
getMatchedStylesForNode
Link copied to clipboard
Returns requested styles for a DOM node identified by nodeId.
getMediaQueries
Link copied to clipboard
fun getMediaQueries(): Single<GetMediaQueriesResponse>
Returns all media queries parsed by the rendering engine.
getPlatformFontsForNode
Link copied to clipboard
Requests information about platform fonts which we used to render child TextNodes in the given node.
getStyleSheetText
Link copied to clipboard
fun getStyleSheetText(input: GetStyleSheetTextRequest): Single<GetStyleSheetTextResponse>
Returns the current textual content for a stylesheet.
mediaQueryResultChanged
Link copied to clipboard
fun mediaQueryResultChanged(): Flowable<RawEvent>
Fires whenever a MediaQuery result changes (for example, after a browser window has been resized.) The current implementation considers only viewport-dependent media features.
name
Link copied to clipboard
fun name(): String
Returns domain name.
setEffectivePropertyValueForNode
Link copied to clipboard
Find a rule with the given active property for the given node and set the new value for this property
setKeyframeKey
Link copied to clipboard
fun setKeyframeKey(input: SetKeyframeKeyRequest): Single<SetKeyframeKeyResponse>
Modifies the keyframe rule key text.
setLocalFontsEnabled
Link copied to clipboard
fun setLocalFontsEnabled(input: SetLocalFontsEnabledRequest): Single<RequestResponseFrame>
Enables/disables rendering of local CSS fonts (enabled by default).
setMediaText
Link copied to clipboard
fun setMediaText(input: SetMediaTextRequest): Single<SetMediaTextResponse>
Modifies the rule selector.
setRuleSelector
Link copied to clipboard
fun setRuleSelector(input: SetRuleSelectorRequest): Single<SetRuleSelectorResponse>
Modifies the rule selector.
setStyleSheetText
Link copied to clipboard
fun setStyleSheetText(input: SetStyleSheetTextRequest): Single<SetStyleSheetTextResponse>
Sets the new stylesheet text.
setStyleTexts
Link copied to clipboard
fun setStyleTexts(input: SetStyleTextsRequest): Single<SetStyleTextsResponse>
Applies specified style edits one after another in the given order.
startRuleUsageTracking
Link copied to clipboard
fun startRuleUsageTracking(): Single<RequestResponseFrame>
Enables the selector recording.
stopRuleUsageTracking
Link copied to clipboard
fun stopRuleUsageTracking(): Single<StopRuleUsageTrackingResponse>
Stop tracking rule usage and return the list of rules that were used since last call to takeCoverageDelta (or since start of coverage instrumentation)
styleSheetAdded
Link copied to clipboard
fun styleSheetAdded(): Flowable<StyleSheetAddedEvent>
Fired whenever an active document stylesheet is added.
styleSheetChanged
Link copied to clipboard
fun styleSheetChanged(): Flowable<StyleSheetChangedEvent>
Fired whenever a stylesheet is changed as a result of the client operation.
styleSheetRemoved
Link copied to clipboard
fun styleSheetRemoved(): Flowable<StyleSheetRemovedEvent>
Fired whenever an active document stylesheet is removed.
takeComputedStyleUpdates
Link copied to clipboard
fun takeComputedStyleUpdates(): Single<TakeComputedStyleUpdatesResponse>
Polls the next batch of computed style updates.
takeCoverageDelta
Link copied to clipboard
fun takeCoverageDelta(): Single<TakeCoverageDeltaResponse>
Obtain list of rules that became used since last call to this method (or since start of coverage instrumentation)
trackComputedStyleUpdates
Link copied to clipboard
Starts tracking the given computed styles for updates.

Sources

jvm source
Link copied to clipboard